<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.25" charset="UTF-8">
    <title>Item List</title>
    <link rel="StyleSheet" href="/css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<header th:replace="common/top"></header>
<div id="Content">
    <h2>Item Management</h2>
    <a th:href="@{/adminItem/editItem}">Add New Item</a>
    <table>
        <tr>
            <th>Item ID</th>
            <th>Product ID</th>
            <th>List Price</th>
            <th>Attributes</th>
            <th>Actions</th>
        </tr>
        <tr th:each="item : ${items}">
            <td th:text="${item.itemId}"></td>
            <td th:text="${item.productId}"></td>
            <td th:text="${item.listPrice} +'$'"></td>
            <td th:text="${item.attribute1}"></td>
            <td>
                <a th:href="@{/catalog/AdminEditOneItem(itemId=${item.itemId})}">Edit</a>
                <a th:href="@{/catalog/deleteItem(itemId=${item.itemId})}" onclick="return confirm('Are you sure?');">Delete</a>
            </td>
        </tr>
    </table>
</div>
<footer th:replace="common/bottom"></footer>

<!--脚本-->
<script th:src="@{/js/background.js}" count="500"></script>
</body>
</html>
